import request from '@/utils/request'

// 添加文章文档
export function addArticleDocument(data) {
  return request({
    url: '/search/document/article',
    method: 'post',
    data: data
  })
}

// 添加分类文档
export function addCategoryDocument(data) {
  return request({
    url: '/search/document/category',
    method: 'post',
    data: data
  })
}

// 添加标签文档
export function addTagDocument(data) {
  return request({
    url: '/search/document/tag',
    method: 'post',
    data: data
  })
}

// 搜索文档
export function searchDocument(query) {
  return request({
    url: '/search/query',
    method: 'get',
    params: query
  })
}

// 根据类型搜索文档
export function searchDocumentByType(type, query) {
  return request({
    url: '/search/query/' + type,
    method: 'get',
    params: query
  })
}